package com.smedi.ismedi.authoritymanagement.core.infrastructure.constant;

public final class ConstantField {
    // 租户id
    public final static String tenantId = "tenant_id";

    // 顶层组织id
    public final static String topOrgId = "top_org_id";

    // 自增数量
    public final static int pingyinIncrease = 3;

    // 验证码有效时长
    public final static Long verificationCodeLive = 300L;

    // 验证码存储路径
    public final static String verificationCodePath = "supporting-domian:authority-management:verification-code:";

    // 验证码通过后可重置密码的有效期
    public final static Long waitingResetPasswordLive = 300L;

    // 验证码通过后可重置密码的有效期的存储路径
    public final static String waitingResetPasswordPath = "supporting-domian:authority-management:waiting-reset-password:";

    // pc客户端
    public final static String pc = "pc";

    // mobile客户端
    public final static String mobile = "mobile";

    // 登录session存储路径
    public final static String accessSessionPath = "supporting-domian:authority-management:access:";

    // pc登录Session存储路径
    public final static String accessSessionPcPath = accessSessionPath + pc + ":";

    // mobile登录Session存储路径
    public final static String accessSessionMobilePath = accessSessionPath + mobile + ":";

    // PC有效期（一小时）
    public final static Long clientPcLive = 3600 * 24 * 90L;

    public final static Long TOKEN_TIME = 60 * 60 * 24 * 30L;

    // 移动端有效期（一天）
    public final static Long clientMobileLive = 3600 * 24 * 90L;

    // token长度
    public final static int tokenLength = 19;

    public enum ElementTypeStatusEnum {
        /**
         * 模块
         */
        MODULE,
        /**
         * 菜单
         */
        MENU,
        /**
         * 页面
         */
        PAGE,
        /**
         * 摁钮
         */
        BUTTON
    }

    public enum PersonLevelEnum {
        /**
         * 总院层级
         */
        INSTITUTION("总院层级"),
        /**
         * 主体院层级
         */
        ORGANIZATION("主体院层级"),
        /**
         * 项目层级
         */
        PROJECT("项目层级");

        private final String value;

        PersonLevelEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return this.value;
        }

        public static String getValue(String key) {
            for (PersonLevelEnum personLevelEnum : PersonLevelEnum.values()) {
                if (personLevelEnum.name().equals(key)) {
                    return personLevelEnum.getValue();
                }
            }
            return "";
        }
    }

    public final static String COLONS = ":";

    public final static Long TOKEN_EFFECTIVE_TIME = 60L;


    public enum RoleTypeEnum {
        /**
         * 总院角色
         */
        INSTITUTION_ROLE("总院角色"),
        /**
         * 主体院角色
         */
        ORGANIZATION_ROLE("主体院角色"),
        /**
         * 项目角色
         */
        PROJECT_ROLE("项目角色");

        private final String value;

        public String getValue() {
            return value;
        }

        RoleTypeEnum(String value) {
            this.value = value;
        }

        public static String getRoleTypeValue(String key) {
            for (RoleTypeEnum roleTypeEnum : RoleTypeEnum.values()) {
                if (roleTypeEnum.name().equals(key)) {
                    return roleTypeEnum.getValue();
                }
            }
            return "";
        }
    }
}


